import type {Recordable} from '@vben/types';
import {defineStore} from 'pinia';
import {registerApi} from "#/api";
// import { generateRoutes } from '@vben/utils';

export const useRegisterStore = defineStore('register', () => {


  /**
   * 异步处理登录操作
   * Asynchronously handle the login process
   * @param params 登录表单数据
   */
  async function userRegister(
    params: Recordable<any>,
    onSuccess?: () => Promise<void> | void,
  ) {
    // 调用 loginApi，获取返回值 response
    const response = await registerApi(params);
    console.log(response)

    // return { userInfo };
  }


  return {
    userRegister
  };
});
